/** layui-v2.2.5 MIT License By https://www.layui.com */
!function(e) {
    var t = document
      , n = {
        modules: {},
        status: {},
        timeout: 10,
        event: {}
    }
      , o = function() {
        this.v = "2.2.5"
    }
      , r = function() {
        var e = t.currentScript ? t.currentScript.src : function() {
            for (var e, n = t.scripts, o = n.length - 1, r = o; r > 0; r--) {
                if ("interactive" === n[r].readyState) {
                    e = n[r].src;
                    break
                }
            }
            return e || n[o].src
        }();
        return e.substring(0, e.lastIndexOf("/") + 1)
    }()
      , a = function(t) {
        e.console && console.error && console.error("Layui hint: " + t)
    }
      , i = "undefined" != typeof opera && "[object Opera]" === opera.toString()
      , u = {
        layer: "modules/layer",
        laydate: "modules/laydate",
        laypage: "modules/laypage",
        laytpl: "modules/laytpl",
        layim: "modules/layim",
        layedit: "modules/layedit",
        form: "modules/form",
        upload: "modules/upload",
        tree: "modules/tree",
        table: "modules/table",
        element: "modules/element",
        util: "modules/util",
        flow: "modules/flow",
        carousel: "modules/carousel",
        code: "modules/code",
        jquery: "modules/jquery",
        mobile: "modules/mobile",
        message: "modules/message",
        search_date: "modules/search_date",
        "layui.all": "../layui.all"
    };
    o.prototype.cache = n,
    o.prototype.define = function(e, t) {
        var o = this
          , r = "function" == typeof e
          , a = function() {
            var e = function(e, t) {
                layui[e] = t,
                n.status[e] = !0
            };
            return "function" == typeof t && t(function(o, r) {
                e(o, r),
                n.callback[o] = function() {
                    t(e)
                }
            }),
            this
        };
        return r && (t = e,
        e = []),
        layui["layui.all"] || !layui["layui.all"] && layui["layui.mobile"] ? a.call(o) : (o.use(e, a),
        o)
    }
    ,
    o.prototype.use = function(e, o, l) {
        function s(e, t) {
            var o = "PLaySTATION 3" === navigator.platform ? /^complete$/ : /^(complete|loaded)$/;
            ("load" === e.type || o.test((e.currentTarget || e.srcElement).readyState)) && (n.modules[f] = t,
            d.removeChild(v),
            function r() {
                return ++m > 1000 * n.timeout / 4 ? a(f + " is not a valid module") : void (n.status[f] ? c() : setTimeout(r, 4))
            }())
        }
        function c() {
            l.push(layui[f]),
            e.length > 1 ? y.use(e.slice(1), o, l) : "function" == typeof o && o.apply(layui, l)
        }
        var y = this
          , p = n.dir = n.dir ? n.dir : r
          , d = t.getElementsByTagName("head")[0];
        e = "string" == typeof e ? [e] : e,
        window.jQuery && jQuery.fn.on && (y.each(e, function(t, n) {
            "jquery" === n && e.splice(t, 1)
        }),
        layui.jquery = layui.$ = jQuery);
        var f = e[0]
          , m = 0;
        if (l = l || [],
        n.host = n.host || (p.match(/\/\/([\s\S]+?)\//) || ["//" + location.host + "/"])[0],
        0 === e.length || layui["layui.all"] && u[f] || !layui["layui.all"] && layui["layui.mobile"] && u[f]) {
            return c(),
            y
        }
        if (n.modules[f]) {
            !function g() {
                return ++m > 1000 * n.timeout / 4 ? a(f + " is not a valid module") : void ("string" == typeof n.modules[f] && n.status[f] ? c() : setTimeout(g, 4))
            }()
        } else {
            var v = t.createElement("script")
              , h = (u[f] ? p + "lay/" : /^\{\/\}/.test(y.modules[f]) ? "" : n.base || "") + (y.modules[f] || f) + ".js";
            h = h.replace(/^\{\/\}/, ""),
            v.async = !0,
            v.charset = "utf-8",
            v.src = h + function() {
                var e = n.version === !0 ? n.v || (new Date).getTime() : n.version || "";
                return e ? "?v=" + e : ""
            }(),
            d.appendChild(v),
            !v.attachEvent || v.attachEvent.toString && v.attachEvent.toString().indexOf("[native code") < 0 || i ? v.addEventListener("load", function(e) {
                s(e, h)
            }, !1) : v.attachEvent("onreadystatechange", function(e) {
                s(e, h)
            }),
            n.modules[f] = h
        }
        return y
    }
    ,
    o.prototype.getStyle = function(t, n) {
        var o = t.currentStyle ? t.currentStyle : e.getComputedStyle(t, null);
        return o[o.getPropertyValue ? "getPropertyValue" : "getAttribute"](n)
    }
    ,
    o.prototype.link = function(e, o, r) {
        var i = this
          , u = t.createElement("link")
          , l = t.getElementsByTagName("head")[0];
        "string" == typeof o && (r = o);
        var s = (r || e).replace(/\.|\//g, "")
          , c = u.id = "layuicss-" + s
          , y = 0;
        return u.rel = "stylesheet",
        u.href = e + (n.debug ? "?v=" + (new Date).getTime() : ""),
        u.media = "all",
        t.getElementById(c) || l.appendChild(u),
        "function" != typeof o ? i : (function p() {
            return ++y > 1000 * n.timeout / 100 ? a(e + " timeout") : void (1989 === parseInt(i.getStyle(t.getElementById(c), "width")) ? function() {
                o()
            }() : setTimeout(p, 100))
        }(),
        i)
    }
    ,
    n.callback = {},
    o.prototype.factory = function(e) {
        if (layui[e]) {
            return "function" == typeof n.callback[e] ? n.callback[e] : null
        }
    }
    ,
    o.prototype.addcss = function(e, t, o) {
        return layui.link(n.dir + "css/" + e, t, o)
    }
    ,
    o.prototype.img = function(e, t, n) {
        var o = new Image;
        return o.src = e,
        o.complete ? t(o) : (o.onload = function() {
            o.onload = null,
            t(o)
        }
        ,
        void (o.onerror = function(e) {
            o.onerror = null,
            n(e)
        }
        ))
    }
    ,
    o.prototype.config = function(e) {
        e = e || {};
        for (var t in e) {
            n[t] = e[t]
        }
        return this
    }
    ,
    o.prototype.modules = function() {
        var e = {};
        for (var t in u) {
            e[t] = u[t]
        }
        return e
    }(),
    o.prototype.extend = function(e) {
        var t = this;
        e = e || {};
        for (var n in e) {
            t[n] || t.modules[n] ? a("模块名 " + n + " 已被占用") : t.modules[n] = e[n]
        }
        return t
    }
    ,
    o.prototype.router = function(e) {
        var t = this
          , e = e || location.hash
          , n = {
            path: [],
            search: {},
            hash: (e.match(/[^#](#.*$)/) || [])[1] || ""
        };
        return /^#\//.test(e) ? (n.href = e = e.replace(/^#\//, ""),
        e = e.replace(/([^#])(#.*$)/, "$1").split("/") || [],
        t.each(e, function(e, t) {
            /^\w+=/.test(t) ? function() {
                t = t.split("="),
                n.search[t[0]] = t[1]
            }() : n.path.push(t)
        }),
        n) : n
    }
    ,
    o.prototype.data = function(t, n, o) {
        if (t = t || "layui",
        o = o || localStorage,
        e.JSON && e.JSON.parse) {
            if (null === n) {
                return delete o[t]
            }
            n = "object" == typeof n ? n : {
                key: n
            };
            try {
                var r = JSON.parse(o[t])
            } catch (a) {
                var r = {}
            }
            return "value"in n && (r[n.key] = n.value),
            n.remove && delete r[n.key],
            o[t] = JSON.stringify(r),
            n.key ? r[n.key] : r
        }
    }
    ,
    o.prototype.sessionData = function(e, t) {
        return this.data(e, t, sessionStorage)
    }
    ,
    o.prototype.device = function(t) {
        var n = navigator.userAgent.toLowerCase()
          , o = function(e) {
            var t = new RegExp(e + "/([^\\s\\_\\-]+)");
            return e = (n.match(t) || [])[1],
            e || !1
        }
          , r = {
            os: function() {
                return /windows/.test(n) ? "windows" : /linux/.test(n) ? "linux" : /iphone|ipod|ipad|ios/.test(n) ? "ios" : /mac/.test(n) ? "mac" : void 0
            }(),
            ie: function() {
                return !!(e.ActiveXObject || "ActiveXObject"in e) && ((n.match(/msie\s(\d+)/) || [])[1] || "11")
            }(),
            weixin: o("micromessenger")
        };
        return t && !r[t] && (r[t] = o(t)),
        r.android = /android/.test(n),
        r.ios = "ios" === r.os,
        r
    }
    ,
    o.prototype.hint = function() {
        return {
            error: a
        }
    }
    ,
    o.prototype.each = function(e, t) {
        var n, o = this;
        if ("function" != typeof t) {
            return o
        }
        if (e = e || [],
        e.constructor === Object) {
            for (n in e) {
                if (t.call(e[n], n, e[n])) {
                    break
                }
            }
        } else {
            for (n = 0; n < e.length && !t.call(e[n], n, e[n]); n++) {}
        }
        return o
    }
    ,
    o.prototype.sort = function(e, t, n) {
        var o = JSON.parse(JSON.stringify(e || []));
        return t ? (o.sort(function(e, n) {
            var o = /^-?\d+$/
              , r = e[t]
              , a = n[t];
            return o.test(r) && (r = parseFloat(r)),
            o.test(a) && (a = parseFloat(a)),
            r && !a ? 1 : !r && a ? -1 : r > a ? 1 : r < a ? -1 : 0
        }),
        n && o.reverse(),
        o) : o
    }
    ,
    o.prototype.stope = function(t) {
        t = t || e.event;
        try {
            t.stopPropagation()
        } catch (n) {
            t.cancelBubble = !0
        }
    }
    ,
    o.prototype.onevent = function(e, t, n) {
        return "string" != typeof e || "function" != typeof n ? this : o.event(e, t, null, n)
    }
    ,
    o.prototype.event = o.event = function(e, t, o, r) {
        var a = this
          , i = null
          , u = t.match(/\((.*)\)$/) || []
          , l = (e + "." + t).replace(u[0], "")
          , s = u[1] || ""
          , c = function(e, t) {
            var n = t && t.call(a, o);
            n === !1 && null === i && (i = !1)
        };
        return r ? (n.event[l] = n.event[l] || {},
        n.event[l][s] = [r],
        this) : (layui.each(n.event[l], function(e, t) {
            return "{*}" === s ? void layui.each(t, c) : ("" === e && layui.each(t, c),
            void (e === s && layui.each(t, c)))
        }),
        i)
    }
    ,
    e.layui = new o
}(window);
;var js = document.scripts;
js = js[js.length - 1].src;
js = js.substring(0, js.lastIndexOf("/") - 2);
layui.base = js;
layui.define(function(a) {
    var i = layui.cache;
    layui.config({
        dir: i.dir.replace(/lay\/dest\/$/, "")
    }),
    a("layui.all", layui.v)
});
!function(n) {
    "use strict";
    function t(n, t) {
        var r = (65535 & n) + (65535 & t)
          , e = (n >> 16) + (t >> 16) + (r >> 16);
        return e << 16 | 65535 & r
    }
    function r(n, t) {
        return n << t | n >>> 32 - t
    }
    function e(n, e, o, u, c, f) {
        return t(r(t(t(e, n), t(u, f)), c), o)
    }
    function o(n, t, r, o, u, c, f) {
        return e(t & r | ~t & o, n, t, u, c, f)
    }
    function u(n, t, r, o, u, c, f) {
        return e(t & o | r & ~o, n, t, u, c, f)
    }
    function c(n, t, r, o, u, c, f) {
        return e(t ^ r ^ o, n, t, u, c, f)
    }
    function f(n, t, r, o, u, c, f) {
        return e(r ^ (t | ~o), n, t, u, c, f)
    }
    function i(n, r) {
        n[r >> 5] |= 128 << r % 32,
        n[(r + 64 >>> 9 << 4) + 14] = r;
        var e, i, a, h, d, l = 1732584193, g = -271733879, v = -1732584194, m = 271733878;
        for (e = 0; e < n.length; e += 16)
            i = l,
            a = g,
            h = v,
            d = m,
            l = o(l, g, v, m, n[e], 7, -680876936),
            m = o(m, l, g, v, n[e + 1], 12, -389564586),
            v = o(v, m, l, g, n[e + 2], 17, 606105819),
            g = o(g, v, m, l, n[e + 3], 22, -1044525330),
            l = o(l, g, v, m, n[e + 4], 7, -176418897),
            m = o(m, l, g, v, n[e + 5], 12, 1200080426),
            v = o(v, m, l, g, n[e + 6], 17, -1473231341),
            g = o(g, v, m, l, n[e + 7], 22, -45705983),
            l = o(l, g, v, m, n[e + 8], 7, 1770035416),
            m = o(m, l, g, v, n[e + 9], 12, -1958414417),
            v = o(v, m, l, g, n[e + 10], 17, -42063),
            g = o(g, v, m, l, n[e + 11], 22, -1990404162),
            l = o(l, g, v, m, n[e + 12], 7, 1804603682),
            m = o(m, l, g, v, n[e + 13], 12, -40341101),
            v = o(v, m, l, g, n[e + 14], 17, -1502002290),
            g = o(g, v, m, l, n[e + 15], 22, 1236535329),
            l = u(l, g, v, m, n[e + 1], 5, -165796510),
            m = u(m, l, g, v, n[e + 6], 9, -1069501632),
            v = u(v, m, l, g, n[e + 11], 14, 643717713),
            g = u(g, v, m, l, n[e], 20, -373897302),
            l = u(l, g, v, m, n[e + 5], 5, -701558691),
            m = u(m, l, g, v, n[e + 10], 9, 38016083),
            v = u(v, m, l, g, n[e + 15], 14, -660478335),
            g = u(g, v, m, l, n[e + 4], 20, -405537848),
            l = u(l, g, v, m, n[e + 9], 5, 568446438),
            m = u(m, l, g, v, n[e + 14], 9, -1019803690),
            v = u(v, m, l, g, n[e + 3], 14, -187363961),
            g = u(g, v, m, l, n[e + 8], 20, 1163531501),
            l = u(l, g, v, m, n[e + 13], 5, -1444681467),
            m = u(m, l, g, v, n[e + 2], 9, -51403784),
            v = u(v, m, l, g, n[e + 7], 14, 1735328473),
            g = u(g, v, m, l, n[e + 12], 20, -1926607734),
            l = c(l, g, v, m, n[e + 5], 4, -378558),
            m = c(m, l, g, v, n[e + 8], 11, -2022574463),
            v = c(v, m, l, g, n[e + 11], 16, 1839030562),
            g = c(g, v, m, l, n[e + 14], 23, -35309556),
            l = c(l, g, v, m, n[e + 1], 4, -1530992060),
            m = c(m, l, g, v, n[e + 4], 11, 1272893353),
            v = c(v, m, l, g, n[e + 7], 16, -155497632),
            g = c(g, v, m, l, n[e + 10], 23, -1094730640),
            l = c(l, g, v, m, n[e + 13], 4, 681279174),
            m = c(m, l, g, v, n[e], 11, -358537222),
            v = c(v, m, l, g, n[e + 3], 16, -722521979),
            g = c(g, v, m, l, n[e + 6], 23, 76029189),
            l = c(l, g, v, m, n[e + 9], 4, -640364487),
            m = c(m, l, g, v, n[e + 12], 11, -421815835),
            v = c(v, m, l, g, n[e + 15], 16, 530742520),
            g = c(g, v, m, l, n[e + 2], 23, -995338651),
            l = f(l, g, v, m, n[e], 6, -198630844),
            m = f(m, l, g, v, n[e + 7], 10, 1126891415),
            v = f(v, m, l, g, n[e + 14], 15, -1416354905),
            g = f(g, v, m, l, n[e + 5], 21, -57434055),
            l = f(l, g, v, m, n[e + 12], 6, 1700485571),
            m = f(m, l, g, v, n[e + 3], 10, -1894986606),
            v = f(v, m, l, g, n[e + 10], 15, -1051523),
            g = f(g, v, m, l, n[e + 1], 21, -2054922799),
            l = f(l, g, v, m, n[e + 8], 6, 1873313359),
            m = f(m, l, g, v, n[e + 15], 10, -30611744),
            v = f(v, m, l, g, n[e + 6], 15, -1560198380),
            g = f(g, v, m, l, n[e + 13], 21, 1309151649),
            l = f(l, g, v, m, n[e + 4], 6, -145523070),
            m = f(m, l, g, v, n[e + 11], 10, -1120210379),
            v = f(v, m, l, g, n[e + 2], 15, 718787259),
            g = f(g, v, m, l, n[e + 9], 21, -343485551),
            l = t(l, i),
            g = t(g, a),
            v = t(v, h),
            m = t(m, d);
        return [l, g, v, m]
    }
    function a(n) {
        var t, r = "", e = 32 * n.length;
        for (t = 0; t < e; t += 8)
            r += String.fromCharCode(n[t >> 5] >>> t % 32 & 255);
        return r
    }
    function h(n) {
        var t, r = [];
        for (r[(n.length >> 2) - 1] = void 0,
        t = 0; t < r.length; t += 1)
            r[t] = 0;
        var e = 8 * n.length;
        for (t = 0; t < e; t += 8)
            r[t >> 5] |= (255 & n.charCodeAt(t / 8)) << t % 32;
        return r
    }
    function d(n) {
        return a(i(h(n), 8 * n.length))
    }
    function l(n, t) {
        var r, e, o = h(n), u = [], c = [];
        for (u[15] = c[15] = void 0,
        o.length > 16 && (o = i(o, 8 * n.length)),
        r = 0; r < 16; r += 1)
            u[r] = 909522486 ^ o[r],
            c[r] = 1549556828 ^ o[r];
        return e = i(u.concat(h(t)), 512 + 8 * t.length),
        a(i(c.concat(e), 640))
    }
    function g(n) {
        var t, r, e = "0123456789abcdef", o = "";
        for (r = 0; r < n.length; r += 1)
            t = n.charCodeAt(r),
            o += e.charAt(t >>> 4 & 15) + e.charAt(15 & t);
        return o
    }
    function v(n) {
        return unescape(encodeURIComponent(n))
    }
    function m(n) {
        return d(v(n))
    }
    function p(n) {
        return g(m(n))
    }
    function s(n, t) {
        return l(v(n), v(t))
    }
    function C(n, t) {
        return g(s(n, t))
    }
    function A(n, t, r) {
        return t ? r ? s(t, n) : C(t, n) : r ? m(n) : p(n)
    }
    "function" == typeof define && define.amd ? define(function() {
        return A
    }) : "object" == typeof module && module.exports ? module.exports = A : n.md5 = A
}(this);
layui.define(function(e) {
    var i = layui.jquery
      , n = layui.device()
      , l = "mobi_form"
      , r = ".layui-form"
      , s = "layui-this"
      , o = "layui-hide"
      , c = "layui-disabled"
      , u = function() {
        this.config = {
            verify: {
                required: [/[\S]+/, "必填项不能为空"],
                phone: [/^1\d{10}$/, "请输入正确的手机号"],
                email: [/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/, "邮箱格式不正确"],
                url: [/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/, "链接格式不正确"],
                number: [/^\d+$/, "只能填写数字"],
                date: [/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/, "日期格式不正确"],
                identity: [/(^\d{15}$)|(^\d{17}(x|X|\d)$)/, "请输入正确的身份证号"]
            }
        }
    };
    u.prototype.set = function(e) {
        var t = this;
        return i.extend(!0, t.config, e),
        t
    }
    ,
    u.prototype.verify = function(e) {
        var t = this;
        return i.extend(!0, t.config.verify, e),
        t
    }
    ,
    u.prototype.on = function(e, i) {
        return layui.onevent(l, e, i)
    }
    ,
    u.prototype.render = function(e) {}
    ;
    var d = function() {
        var e = i(this)
          , a = f.config.verify
          , s = null
          , o = "layui-form-danger"
          , c = {}
          , u = e.parents(r)
          , d = u.find("*[lay-verify]")
          , y = e.parents("form")[0]
          , v = u.find("input,select,textarea")
          , h = e.attr("lay-filter");
        var self = this
          , push_counters = {}
          , patterns = {
            "validate": /^[a-zA-Z][a-zA-Z0-9_]*(?:\[(?:\d*|[a-zA-Z0-9_]+)\])*$/,
            "key": /[a-zA-Z0-9_]+|(?=\[\])/g,
            "push": /^$/,
            "fixed": /^\d+$/,
            "named": /^[a-zA-Z0-9_]+$/
        };
        this.build = function(base, key, value) {
            base[key] = value;
            return base
        }
        ;
        this.push_counter = function(key) {
            if (push_counters[key] === undefined) {
                push_counters[key] = 0
            }
            return push_counters[key]++
        }
        ;
        return layui.each(d, function(e, l) {
            var r = i(this)
              , c = r.attr("lay-verify").split("|")
              , u = ""
              , d = r.val();
            if (r.removeClass(o),
            layui.each(c, function(e, i) {
                var c = "function" == typeof a[i];
                if (a[i] && (c ? u = a[i](d, l) : !a[i][0].test(d)))
                    return !$.toast(u || a[i][1]),
                    n.android || n.ios || l.focus(),
                    r.addClass(o),
                    s = !0
            }),
            s)
                return s
        }),
        !s && (layui.each(v, function(e, i) {
            if (i.name && !(/^checkbox|radio$/.test(i.type) && !i.checked)) {
                if (!patterns.validate.test(i.name)) {
                    return
                }
                var k, keys = i.name.match(patterns.key), merge = i.value, reverse_key = i.name;
                while ((k = keys.pop()) !== undefined) {
                    reverse_key = reverse_key.replace(new RegExp("\\[" + k + "\\]$"), '');
                    if (k.match(patterns.push)) {
                        merge = self.build([], self.push_counter(reverse_key), merge)
                    } else if (k.match(patterns.fixed)) {
                        merge = self.build({}, k, merge)
                    } else if (k.match(patterns.named)) {
                        merge = self.build({}, k, merge)
                    }
                }
                c = $.extend(true, c, merge)
            }
        }),

        layui.event.call(this, l, "submit(" + h + ")", {
            elem: this,
            form: y,
            field: c
        }))
    }
      , f = new u
      , y = i(document);
    f.render(),
    y.on("reset", r, function() {}),
    y.on("submit", r, d).on("click", "*[lay-submit]", d);
    e(l, f)
});
layui.define(function(exports) {
    function entrySign(str) {
        return md5(str + 'b10605b229c1fcc8e0a4ddf88369e58e');
    }
    exports('md5', {
        md5: entrySign
    });
})
/*layui-form and md5*/
!function(e, t) {
    if ("object" == typeof exports && "object" == typeof module)
        module.exports = t();
    else if ("function" == typeof define && define.amd)
        define([], t);
    else {
        var n = t();
        for (var r in n)
            ("object" == typeof exports ? exports : e)[r] = n[r]
    }
}(this, function() {
    return function(e) {
        function t(r) {
            if (n[r])
                return n[r].exports;
            var i = n[r] = {
                exports: {},
                id: r,
                loaded: !1
            };
            return e[r].call(i.exports, i, i.exports, t),
            i.loaded = !0,
            i.exports
        }
        var n = {};
        return t.m = e,
        t.c = n,
        t.p = "",
        t(0)
    }([function(e, t, n) {
        n(6),
        n(7),
        e.exports = n(8)
    }
    , function(e, t, n) {
        (function(t) {
            !function(n) {
                function r(e, t) {
                    return function() {
                        e.apply(t, arguments)
                    }
                }
                function i(e) {
                    if ("object" != typeof this)
                        throw new TypeError("Promises must be constructed via new");
                    if ("function" != typeof e)
                        throw new TypeError("not a function");
                    this._state = null,
                    this._value = null,
                    this._deferreds = [],
                    l(e, r(a, this), r(s, this))
                }
                function o(e) {
                    var t = this;
                    return null === this._state ? void this._deferreds.push(e) : void f(function() {
                        var n = t._state ? e.onFulfilled : e.onRejected;
                        if (null === n)
                            return void (t._state ? e.resolve : e.reject)(t._value);
                        var r;
                        try {
                            r = n(t._value)
                        } catch (i) {
                            return void e.reject(i)
                        }
                        e.resolve(r)
                    })
                }
                function a(e) {
                    try {
                        if (e === this)
                            throw new TypeError("A promise cannot be resolved with itself.");
                        if (e && ("object" == typeof e || "function" == typeof e)) {
                            var t = e.then;
                            if ("function" == typeof t)
                                return void l(r(t, e), r(a, this), r(s, this))
                        }
                        this._state = !0,
                        this._value = e,
                        u.call(this)
                    } catch (n) {
                        s.call(this, n)
                    }
                }
                function s(e) {
                    this._state = !1,
                    this._value = e,
                    u.call(this)
                }
                function u() {
                    for (var e = 0, t = this._deferreds.length; t > e; e++)
                        o.call(this, this._deferreds[e]);
                    this._deferreds = null
                }
                function c(e, t, n, r) {
                    this.onFulfilled = "function" == typeof e ? e : null,
                    this.onRejected = "function" == typeof t ? t : null,
                    this.resolve = n,
                    this.reject = r
                }
                function l(e, t, n) {
                    var r = !1;
                    try {
                        e(function(e) {
                            r || (r = !0,
                            t(e))
                        }, function(e) {
                            r || (r = !0,
                            n(e))
                        })
                    } catch (i) {
                        if (r)
                            return;
                        r = !0,
                        n(i)
                    }
                }
                var f = "function" == typeof t && t || function(e) {
                    setTimeout(e, 1)
                }
                  , d = Array.isArray || function(e) {
                    return "[object Array]" === Object.prototype.toString.call(e)
                }
                ;
                i.prototype["catch"] = function(e) {
                    return this.then(null, e)
                }
                ,
                i.prototype.then = function(e, t) {
                    var n = this;
                    return new i(function(r, i) {
                        o.call(n, new c(e,t,r,i))
                    }
                    )
                }
                ,
                i.all = function() {
                    var e = Array.prototype.slice.call(1 === arguments.length && d(arguments[0]) ? arguments[0] : arguments);
                    return new i(function(t, n) {
                        function r(o, a) {
                            try {
                                if (a && ("object" == typeof a || "function" == typeof a)) {
                                    var s = a.then;
                                    if ("function" == typeof s)
                                        return void s.call(a, function(e) {
                                            r(o, e)
                                        }, n)
                                }
                                e[o] = a,
                                0 === --i && t(e)
                            } catch (u) {
                                n(u)
                            }
                        }
                        if (0 === e.length)
                            return t([]);
                        for (var i = e.length, o = 0; o < e.length; o++)
                            r(o, e[o])
                    }
                    )
                }
                ,
                i.resolve = function(e) {
                    return e && "object" == typeof e && e.constructor === i ? e : new i(function(t) {
                        t(e)
                    }
                    )
                }
                ,
                i.reject = function(e) {
                    return new i(function(t, n) {
                        n(e)
                    }
                    )
                }
                ,
                i.race = function(e) {
                    return new i(function(t, n) {
                        for (var r = 0, i = e.length; i > r; r++)
                            e[r].then(t, n)
                    }
                    )
                }
                ,
                i._setImmediateFn = function(e) {
                    f = e
                }
                ,
                i.prototype.always = function(e) {
                    var t = this.constructor;
                    return this.then(function(n) {
                        return t.resolve(e()).then(function() {
                            return n
                        })
                    }, function(n) {
                        return t.resolve(e()).then(function() {
                            throw n
                        })
                    })
                }
                ,
                "undefined" != typeof e && e.exports ? e.exports = i : n.Promise || (n.Promise = i)
            }(this)
        }
        ).call(t, n(2).setImmediate)
    }
    , function(e, t, n) {
        (function(e, r) {
            function i(e, t) {
                this._id = e,
                this._clearFn = t
            }
            var o = n(3).nextTick
              , a = Function.prototype.apply
              , s = Array.prototype.slice
              , u = {}
              , c = 0;
            t.setTimeout = function() {
                return new i(a.call(setTimeout, window, arguments),clearTimeout)
            }
            ,
            t.setInterval = function() {
                return new i(a.call(setInterval, window, arguments),clearInterval)
            }
            ,
            t.clearTimeout = t.clearInterval = function(e) {
                e.close()
            }
            ,
            i.prototype.unref = i.prototype.ref = function() {}
            ,
            i.prototype.close = function() {
                this._clearFn.call(window, this._id)
            }
            ,
            t.enroll = function(e, t) {
                clearTimeout(e._idleTimeoutId),
                e._idleTimeout = t
            }
            ,
            t.unenroll = function(e) {
                clearTimeout(e._idleTimeoutId),
                e._idleTimeout = -1
            }
            ,
            t._unrefActive = t.active = function(e) {
                clearTimeout(e._idleTimeoutId);
                var t = e._idleTimeout;
                t >= 0 && (e._idleTimeoutId = setTimeout(function() {
                    e._onTimeout && e._onTimeout()
                }, t))
            }
            ,
            t.setImmediate = "function" == typeof e ? e : function(e) {
                var n = c++
                  , r = arguments.length < 2 ? !1 : s.call(arguments, 1);
                return u[n] = !0,
                o(function() {
                    u[n] && (r ? e.apply(null, r) : e.call(null),
                    t.clearImmediate(n))
                }),
                n
            }
            ,
            t.clearImmediate = "function" == typeof r ? r : function(e) {
                delete u[e]
            }
        }
        ).call(t, n(2).setImmediate, n(2).clearImmediate)
    }
    , function(e, t) {
        function n() {
            c = !1,
            a.length ? u = a.concat(u) : l = -1,
            u.length && r()
        }
        function r() {
            if (!c) {
                var e = setTimeout(n);
                c = !0;
                for (var t = u.length; t; ) {
                    for (a = u,
                    u = []; ++l < t; )
                        a && a[l].run();
                    l = -1,
                    t = u.length
                }
                a = null,
                c = !1,
                clearTimeout(e)
            }
        }
        function i(e, t) {
            this.fun = e,
            this.array = t
        }
        function o() {}
        var a, s = e.exports = {}, u = [], c = !1, l = -1;
        s.nextTick = function(e) {
            var t = new Array(arguments.length - 1);
            if (arguments.length > 1)
                for (var n = 1; n < arguments.length; n++)
                    t[n - 1] = arguments[n];
            u.push(new i(e,t)),
            1 !== u.length || c || setTimeout(r, 0)
        }
        ,
        i.prototype.run = function() {
            this.fun.apply(null, this.array)
        }
        ,
        s.title = "browser",
        s.browser = !0,
        s.env = {},
        s.argv = [],
        s.version = "",
        s.versions = {},
        s.on = o,
        s.addListener = o,
        s.once = o,
        s.off = o,
        s.removeListener = o,
        s.removeAllListeners = o,
        s.emit = o,
        s.binding = function(e) {
            throw new Error("process.binding is not supported")
        }
        ,
        s.cwd = function() {
            return "/"
        }
        ,
        s.chdir = function(e) {
            throw new Error("process.chdir is not supported")
        }
        ,
        s.umask = function() {
            return 0
        }
    }
    , function(e, t) {
        function n() {
            var e = ~navigator.userAgent.indexOf("Android") && ~navigator.vendor.indexOf("Google") && !~navigator.userAgent.indexOf("Chrome");
            return e && navigator.userAgent.match(/AppleWebKit\/(\d+)/).pop() <= 534 || /MQQBrowser/g.test(navigator.userAgent)
        }
        var r = function() {
            try {
                return new Blob,
                !0
            } catch (e) {
                return !1
            }
        }() ? window.Blob : function(e, t) {
            var n = new (window.BlobBuilder || window.WebKitBlobBuilder || window.MSBlobBuilder || window.MozBlobBuilder);
            return e.forEach(function(e) {
                n.append(e)
            }),
            n.getBlob(t ? t.type : void 0)
        }
          , i = function() {
            function e() {
                var e = this
                  , n = []
                  , i = Array(21).join("-") + (+new Date * (1e16 * Math.random())).toString(36)
                  , o = XMLHttpRequest.prototype.send;
                this.getParts = function() {
                    return n.toString()
                }
                ,
                this.append = function(e, t, r) {
                    n.push("--" + i + '\r\nContent-Disposition: form-data; name="' + e + '"'),
                    t instanceof Blob ? (n.push('; filename="' + (r || "blob") + '"\r\nContent-Type: ' + t.type + "\r\n\r\n"),
                    n.push(t)) : n.push("\r\n\r\n" + t),
                    n.push("\r\n")
                }
                ,
                t++,
                XMLHttpRequest.prototype.send = function(a) {
                    var s, u, c = this;
                    a === e ? (n.push("--" + i + "--\r\n"),
                    u = new r(n),
                    s = new FileReader,
                    s.onload = function() {
                        o.call(c, s.result)
                    }
                    ,
                    s.onerror = function(e) {
                        throw e
                    }
                    ,
                    s.readAsArrayBuffer(u),
                    this.setRequestHeader("Content-Type", "multipart/form-data; boundary=" + i),
                    t--,
                    0 == t && (XMLHttpRequest.prototype.send = o)) : o.call(this, a)
                }
            }
            var t = 0;
            return e.prototype = Object.create(FormData.prototype),
            e
        }();
        e.exports = {
            Blob: r,
            FormData: n() ? i : FormData
        }
    }
    , function(e, t, n) {
        var r, i;
        (function() {
            function n(e) {
                return !!e.exifdata
            }
            function o(e, t) {
                t = t || e.match(/^data\:([^\;]+)\;base64,/im)[1] || "",
                e = e.replace(/^data\:([^\;]+)\;base64,/gim, "");
                for (var n = atob(e), r = n.length, i = new ArrayBuffer(r), o = new Uint8Array(i), a = 0; r > a; a++)
                    o[a] = n.charCodeAt(a);
                return i
            }
            function a(e, t) {
                var n = new XMLHttpRequest;
                n.open("GET", e, !0),
                n.responseType = "blob",
                n.onload = function(e) {
                    (200 == this.status || 0 === this.status) && t(this.response)
                }
                ,
                n.send()
            }
            function s(e, t) {
                function n(n) {
                    var r = u(n)
                      , i = c(n);
                    e.exifdata = r || {},
                    e.iptcdata = i || {},
                    t && t.call(e)
                }
                if (e.src)
                    if (/^data\:/i.test(e.src)) {
                        var r = o(e.src);
                        n(r)
                    } else if (/^blob\:/i.test(e.src)) {
                        var i = new FileReader;
                        i.onload = function(e) {
                            n(e.target.result)
                        }
                        ,
                        a(e.src, function(e) {
                            i.readAsArrayBuffer(e)
                        })
                    } else {
                        var s = new XMLHttpRequest;
                        s.onload = function() {
                            200 == this.status || 0 === this.status ? n(s.response) : t(new Error("Could not load image")),
                            s = null
                        }
                        ,
                        s.open("GET", e.src, !0),
                        s.responseType = "arraybuffer",
                        s.send(null)
                    }
                else if (window.FileReader && (e instanceof window.Blob || e instanceof window.File)) {
                    var i = new FileReader;
                    i.onload = function(e) {
                        p && console.log("Got file of length " + e.target.result.byteLength),
                        n(e.target.result)
                    }
                    ,
                    i.readAsArrayBuffer(e)
                }
            }
            function u(e) {
                var t = new DataView(e);
                if (p && console.log("Got file of length " + e.byteLength),
                255 != t.getUint8(0) || 216 != t.getUint8(1))
                    return p && console.log("Not a valid JPEG"),
                    !1;
                for (var n, r = 2, i = e.byteLength; i > r; ) {
                    if (255 != t.getUint8(r))
                        return p && console.log("Not a valid marker at offset " + r + ", found: " + t.getUint8(r)),
                        !1;
                    if (n = t.getUint8(r + 1),
                    p && console.log(n),
                    225 == n)
                        return p && console.log("Found 0xFFE1 marker"),
                        g(t, r + 4, t.getUint16(r + 2) - 2);
                    r += 2 + t.getUint16(r + 2)
                }
            }
            function c(e) {
                var t = new DataView(e);
                if (p && console.log("Got file of length " + e.byteLength),
                255 != t.getUint8(0) || 216 != t.getUint8(1))
                    return p && console.log("Not a valid JPEG"),
                    !1;
                for (var n = 2, r = e.byteLength, i = function(e, t) {
                    return 56 === e.getUint8(t) && 66 === e.getUint8(t + 1) && 73 === e.getUint8(t + 2) && 77 === e.getUint8(t + 3) && 4 === e.getUint8(t + 4) && 4 === e.getUint8(t + 5)
                }; r > n; ) {
                    if (i(t, n)) {
                        var o = t.getUint8(n + 7);
                        o % 2 !== 0 && (o += 1),
                        0 === o && (o = 4);
                        var a = n + 8 + o
                          , s = t.getUint16(n + 6 + o);
                        return l(e, a, s)
                    }
                    n++
                }
            }
            function l(e, t, n) {
                for (var r, i, o, a, s, u = new DataView(e), c = {}, l = t; t + n > l; )
                    28 === u.getUint8(l) && 2 === u.getUint8(l + 1) && (a = u.getUint8(l + 2),
                    a in S && (o = u.getInt16(l + 3),
                    s = o + 5,
                    i = S[a],
                    r = h(u, l + 5, o),
                    c.hasOwnProperty(i) ? c[i]instanceof Array ? c[i].push(r) : c[i] = [c[i], r] : c[i] = r)),
                    l++;
                return c
            }
            function f(e, t, n, r, i) {
                var o, a, s, u = e.getUint16(n, !i), c = {};
                for (s = 0; u > s; s++)
                    o = n + 12 * s + 2,
                    a = r[e.getUint16(o, !i)],
                    !a && p && console.log("Unknown tag: " + e.getUint16(o, !i)),
                    c[a] = d(e, o, t, n, i);
                return c
            }
            function d(e, t, n, r, i) {
                var o, a, s, u, c, l, f = e.getUint16(t + 2, !i), d = e.getUint32(t + 4, !i), g = e.getUint32(t + 8, !i) + n;
                switch (f) {
                case 1:
                case 7:
                    if (1 == d)
                        return e.getUint8(t + 8, !i);
                    for (o = d > 4 ? g : t + 8,
                    a = [],
                    u = 0; d > u; u++)
                        a[u] = e.getUint8(o + u);
                    return a;
                case 2:
                    return o = d > 4 ? g : t + 8,
                    h(e, o, d - 1);
                case 3:
                    if (1 == d)
                        return e.getUint16(t + 8, !i);
                    for (o = d > 2 ? g : t + 8,
                    a = [],
                    u = 0; d > u; u++)
                        a[u] = e.getUint16(o + 2 * u, !i);
                    return a;
                case 4:
                    if (1 == d)
                        return e.getUint32(t + 8, !i);
                    for (a = [],
                    u = 0; d > u; u++)
                        a[u] = e.getUint32(g + 4 * u, !i);
                    return a;
                case 5:
                    if (1 == d)
                        return c = e.getUint32(g, !i),
                        l = e.getUint32(g + 4, !i),
                        s = new Number(c / l),
                        s.numerator = c,
                        s.denominator = l,
                        s;
                    for (a = [],
                    u = 0; d > u; u++)
                        c = e.getUint32(g + 8 * u, !i),
                        l = e.getUint32(g + 4 + 8 * u, !i),
                        a[u] = new Number(c / l),
                        a[u].numerator = c,
                        a[u].denominator = l;
                    return a;
                case 9:
                    if (1 == d)
                        return e.getInt32(t + 8, !i);
                    for (a = [],
                    u = 0; d > u; u++)
                        a[u] = e.getInt32(g + 4 * u, !i);
                    return a;
                case 10:
                    if (1 == d)
                        return e.getInt32(g, !i) / e.getInt32(g + 4, !i);
                    for (a = [],
                    u = 0; d > u; u++)
                        a[u] = e.getInt32(g + 8 * u, !i) / e.getInt32(g + 4 + 8 * u, !i);
                    return a
                }
            }
            function h(e, t, n) {
                var r, i = "";
                for (r = t; t + n > r; r++)
                    i += String.fromCharCode(e.getUint8(r));
                return i
            }
            function g(e, t) {
                if ("Exif" != h(e, t, 4))
                    return p && console.log("Not valid EXIF data! " + h(e, t, 4)),
                    !1;
                var n, r, i, o, a, s = t + 6;
                if (18761 == e.getUint16(s))
                    n = !1;
                else {
                    if (19789 != e.getUint16(s))
                        return p && console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)"),
                        !1;
                    n = !0
                }
                if (42 != e.getUint16(s + 2, !n))
                    return p && console.log("Not valid TIFF data! (no 0x002A)"),
                    !1;
                var u = e.getUint32(s + 4, !n);
                if (8 > u)
                    return p && console.log("Not valid TIFF data! (First offset less than 8)", e.getUint32(s + 4, !n)),
                    !1;
                if (r = f(e, s, s + u, v, n),
                r.ExifIFDPointer) {
                    o = f(e, s, s + r.ExifIFDPointer, w, n);
                    for (i in o) {
                        switch (i) {
                        case "LightSource":
                        case "Flash":
                        case "MeteringMode":
                        case "ExposureProgram":
                        case "SensingMethod":
                        case "SceneCaptureType":
                        case "SceneType":
                        case "CustomRendered":
                        case "WhiteBalance":
                        case "GainControl":
                        case "Contrast":
                        case "Saturation":
                        case "Sharpness":
                        case "SubjectDistanceRange":
                        case "FileSource":
                            o[i] = b[i][o[i]];
                            break;
                        case "ExifVersion":
                        case "FlashpixVersion":
                            o[i] = String.fromCharCode(o[i][0], o[i][1], o[i][2], o[i][3]);
                            break;
                        case "ComponentsConfiguration":
                            o[i] = b.Components[o[i][0]] + b.Components[o[i][1]] + b.Components[o[i][2]] + b.Components[o[i][3]]
                        }
                        r[i] = o[i]
                    }
                }
                if (r.GPSInfoIFDPointer) {
                    a = f(e, s, s + r.GPSInfoIFDPointer, y, n);
                    for (i in a) {
                        switch (i) {
                        case "GPSVersionID":
                            a[i] = a[i][0] + "." + a[i][1] + "." + a[i][2] + "." + a[i][3]
                        }
                        r[i] = a[i]
                    }
                }
                return r
            }
            var p = !1
              , m = function(e) {
                return e instanceof m ? e : this instanceof m ? void (this.EXIFwrapped = e) : new m(e)
            };
            "undefined" != typeof e && e.exports && (t = e.exports = m),
            t.EXIF = m;
            var w = m.Tags = {
                36864: "ExifVersion",
                40960: "FlashpixVersion",
                40961: "ColorSpace",
                40962: "PixelXDimension",
                40963: "PixelYDimension",
                37121: "ComponentsConfiguration",
                37122: "CompressedBitsPerPixel",
                37500: "MakerNote",
                37510: "UserComment",
                40964: "RelatedSoundFile",
                36867: "DateTimeOriginal",
                36868: "DateTimeDigitized",
                37520: "SubsecTime",
                37521: "SubsecTimeOriginal",
                37522: "SubsecTimeDigitized",
                33434: "ExposureTime",
                33437: "FNumber",
                34850: "ExposureProgram",
                34852: "SpectralSensitivity",
                34855: "ISOSpeedRatings",
                34856: "OECF",
                37377: "ShutterSpeedValue",
                37378: "ApertureValue",
                37379: "BrightnessValue",
                37380: "ExposureBias",
                37381: "MaxApertureValue",
                37382: "SubjectDistance",
                37383: "MeteringMode",
                37384: "LightSource",
                37385: "Flash",
                37396: "SubjectArea",
                37386: "FocalLength",
                41483: "FlashEnergy",
                41484: "SpatialFrequencyResponse",
                41486: "FocalPlaneXResolution",
                41487: "FocalPlaneYResolution",
                41488: "FocalPlaneResolutionUnit",
                41492: "SubjectLocation",
                41493: "ExposureIndex",
                41495: "SensingMethod",
                41728: "FileSource",
                41729: "SceneType",
                41730: "CFAPattern",
                41985: "CustomRendered",
                41986: "ExposureMode",
                41987: "WhiteBalance",
                41988: "DigitalZoomRation",
                41989: "FocalLengthIn35mmFilm",
                41990: "SceneCaptureType",
                41991: "GainControl",
                41992: "Contrast",
                41993: "Saturation",
                41994: "Sharpness",
                41995: "DeviceSettingDescription",
                41996: "SubjectDistanceRange",
                40965: "InteroperabilityIFDPointer",
                42016: "ImageUniqueID"
            }
              , v = m.TiffTags = {
                256: "ImageWidth",
                257: "ImageHeight",
                34665: "ExifIFDPointer",
                34853: "GPSInfoIFDPointer",
                40965: "InteroperabilityIFDPointer",
                258: "BitsPerSample",
                259: "Compression",
                262: "PhotometricInterpretation",
                274: "Orientation",
                277: "SamplesPerPixel",
                284: "PlanarConfiguration",
                530: "YCbCrSubSampling",
                531: "YCbCrPositioning",
                282: "XResolution",
                283: "YResolution",
                296: "ResolutionUnit",
                273: "StripOffsets",
                278: "RowsPerStrip",
                279: "StripByteCounts",
                513: "JPEGInterchangeFormat",
                514: "JPEGInterchangeFormatLength",
                301: "TransferFunction",
                318: "WhitePoint",
                319: "PrimaryChromaticities",
                529: "YCbCrCoefficients",
                532: "ReferenceBlackWhite",
                306: "DateTime",
                270: "ImageDescription",
                271: "Make",
                272: "Model",
                305: "Software",
                315: "Artist",
                33432: "Copyright"
            }
              , y = m.GPSTags = {
                0: "GPSVersionID",
                1: "GPSLatitudeRef",
                2: "GPSLatitude",
                3: "GPSLongitudeRef",
                4: "GPSLongitude",
                5: "GPSAltitudeRef",
                6: "GPSAltitude",
                7: "GPSTimeStamp",
                8: "GPSSatellites",
                9: "GPSStatus",
                10: "GPSMeasureMode",
                11: "GPSDOP",
                12: "GPSSpeedRef",
                13: "GPSSpeed",
                14: "GPSTrackRef",
                15: "GPSTrack",
                16: "GPSImgDirectionRef",
                17: "GPSImgDirection",
                18: "GPSMapDatum",
                19: "GPSDestLatitudeRef",
                20: "GPSDestLatitude",
                21: "GPSDestLongitudeRef",
                22: "GPSDestLongitude",
                23: "GPSDestBearingRef",
                24: "GPSDestBearing",
                25: "GPSDestDistanceRef",
                26: "GPSDestDistance",
                27: "GPSProcessingMethod",
                28: "GPSAreaInformation",
                29: "GPSDateStamp",
                30: "GPSDifferential"
            }
              , b = m.StringValues = {
                ExposureProgram: {
                    0: "Not defined",
                    1: "Manual",
                    2: "Normal program",
                    3: "Aperture priority",
                    4: "Shutter priority",
                    5: "Creative program",
                    6: "Action program",
                    7: "Portrait mode",
                    8: "Landscape mode"
                },
                MeteringMode: {
                    0: "Unknown",
                    1: "Average",
                    2: "CenterWeightedAverage",
                    3: "Spot",
                    4: "MultiSpot",
                    5: "Pattern",
                    6: "Partial",
                    255: "Other"
                },
                LightSource: {
                    0: "Unknown",
                    1: "Daylight",
                    2: "Fluorescent",
                    3: "Tungsten (incandescent light)",
                    4: "Flash",
                    9: "Fine weather",
                    10: "Cloudy weather",
                    11: "Shade",
                    12: "Daylight fluorescent (D 5700 - 7100K)",
                    13: "Day white fluorescent (N 4600 - 5400K)",
                    14: "Cool white fluorescent (W 3900 - 4500K)",
                    15: "White fluorescent (WW 3200 - 3700K)",
                    17: "Standard light A",
                    18: "Standard light B",
                    19: "Standard light C",
                    20: "D55",
                    21: "D65",
                    22: "D75",
                    23: "D50",
                    24: "ISO studio tungsten",
                    255: "Other"
                },
                Flash: {
                    0: "Flash did not fire",
                    1: "Flash fired",
                    5: "Strobe return light not detected",
                    7: "Strobe return light detected",
                    9: "Flash fired, compulsory flash mode",
                    13: "Flash fired, compulsory flash mode, return light not detected",
                    15: "Flash fired, compulsory flash mode, return light detected",
                    16: "Flash did not fire, compulsory flash mode",
                    24: "Flash did not fire, auto mode",
                    25: "Flash fired, auto mode",
                    29: "Flash fired, auto mode, return light not detected",
                    31: "Flash fired, auto mode, return light detected",
                    32: "No flash function",
                    65: "Flash fired, red-eye reduction mode",
                    69: "Flash fired, red-eye reduction mode, return light not detected",
                    71: "Flash fired, red-eye reduction mode, return light detected",
                    73: "Flash fired, compulsory flash mode, red-eye reduction mode",
                    77: "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",
                    79: "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",
                    89: "Flash fired, auto mode, red-eye reduction mode",
                    93: "Flash fired, auto mode, return light not detected, red-eye reduction mode",
                    95: "Flash fired, auto mode, return light detected, red-eye reduction mode"
                },
                SensingMethod: {
                    1: "Not defined",
                    2: "One-chip color area sensor",
                    3: "Two-chip color area sensor",
                    4: "Three-chip color area sensor",
                    5: "Color sequential area sensor",
                    7: "Trilinear sensor",
                    8: "Color sequential linear sensor"
                },
                SceneCaptureType: {
                    0: "Standard",
                    1: "Landscape",
                    2: "Portrait",
                    3: "Night scene"
                },
                SceneType: {
                    1: "Directly photographed"
                },
                CustomRendered: {
                    0: "Normal process",
                    1: "Custom process"
                },
                WhiteBalance: {
                    0: "Auto white balance",
                    1: "Manual white balance"
                },
                GainControl: {
                    0: "None",
                    1: "Low gain up",
                    2: "High gain up",
                    3: "Low gain down",
                    4: "High gain down"
                },
                Contrast: {
                    0: "Normal",
                    1: "Soft",
                    2: "Hard"
                },
                Saturation: {
                    0: "Normal",
                    1: "Low saturation",
                    2: "High saturation"
                },
                Sharpness: {
                    0: "Normal",
                    1: "Soft",
                    2: "Hard"
                },
                SubjectDistanceRange: {
                    0: "Unknown",
                    1: "Macro",
                    2: "Close view",
                    3: "Distant view"
                },
                FileSource: {
                    3: "DSC"
                },
                Components: {
                    0: "",
                    1: "Y",
                    2: "Cb",
                    3: "Cr",
                    4: "R",
                    5: "G",
                    6: "B"
                }
            }
              , S = {
                120: "caption",
                110: "credit",
                25: "keywords",
                55: "dateCreated",
                80: "byline",
                85: "bylineTitle",
                122: "captionWriter",
                105: "headline",
                116: "copyright",
                15: "category"
            };
            m.getData = function(e, t) {
                return (e instanceof Image || e instanceof HTMLImageElement) && !e.complete ? !1 : (n(e) ? t && t.call(e) : s(e, t),
                !0)
            }
            ,
            m.getTag = function(e, t) {
                return n(e) ? e.exifdata[t] : void 0
            }
            ,
            m.getAllTags = function(e) {
                if (!n(e))
                    return {};
                var t, r = e.exifdata, i = {};
                for (t in r)
                    r.hasOwnProperty(t) && (i[t] = r[t]);
                return i
            }
            ,
            m.pretty = function(e) {
                if (!n(e))
                    return "";
                var t, r = e.exifdata, i = "";
                for (t in r)
                    r.hasOwnProperty(t) && (i += "object" == typeof r[t] ? r[t]instanceof Number ? t + " : " + r[t] + " [" + r[t].numerator + "/" + r[t].denominator + "]\r\n" : t + " : [" + r[t].length + " values]\r\n" : t + " : " + r[t] + "\r\n");
                return i
            }
            ,
            m.readFromBinaryFile = function(e) {
                return u(e)
            }
            ,
            r = [],
            i = function() {
                return m
            }
            .apply(t, r),
            !(void 0 !== i && (e.exports = i))
        }
        ).call(this)
    }
    , function(e, t, n) {
        var r, i;
        !function() {
            function n(e) {
                var t = e.naturalWidth
                  , n = e.naturalHeight;
                if (t * n > 1048576) {
                    var r = document.createElement("canvas");
                    r.width = r.height = 1;
                    var i = r.getContext("2d");
                    return i.drawImage(e, -t + 1, 0),
                    0 === i.getImageData(0, 0, 1, 1).data[3]
                }
                return !1
            }
            function o(e, t, n) {
                var r = document.createElement("canvas");
                r.width = 1,
                r.height = n;
                var i = r.getContext("2d");
                i.drawImage(e, 0, 0);
                for (var o = i.getImageData(0, 0, 1, n).data, a = 0, s = n, u = n; u > a; ) {
                    var c = o[4 * (u - 1) + 3];
                    0 === c ? s = u : a = u,
                    u = s + a >> 1
                }
                var l = u / n;
                return 0 === l ? 1 : l
            }
            function a(e, t, n) {
                var r = document.createElement("canvas");
                return s(e, r, t, n),
                r.toDataURL("image/jpeg", t.quality || .8)
            }
            function s(e, t, r, i) {
                var a = e.naturalWidth
                  , s = e.naturalHeight
                  , c = r.width
                  , l = r.height
                  , f = t.getContext("2d");
                f.save(),
                u(t, f, c, l, r.orientation);
                var d = n(e);
                d && (a /= 2,
                s /= 2);
                var h = 1024
                  , g = document.createElement("canvas");
                g.width = g.height = h;
                for (var p = g.getContext("2d"), m = i ? o(e, a, s) : 1, w = Math.ceil(h * c / a), v = Math.ceil(h * l / s / m), y = 0, b = 0; s > y; ) {
                    for (var S = 0, I = 0; a > S; )
                        p.clearRect(0, 0, h, h),
                        p.drawImage(e, -S, -y),
                        f.drawImage(g, 0, 0, h, h, I, b, w, v),
                        S += h,
                        I += w;
                    y += h,
                    b += v
                }
                f.restore(),
                g = p = null
            }
            function u(e, t, n, r, i) {
                switch (i) {
                case 5:
                case 6:
                case 7:
                case 8:
                    e.width = r,
                    e.height = n;
                    break;
                default:
                    e.width = n,
                    e.height = r
                }
                switch (i) {
                case 2:
                    t.translate(n, 0),
                    t.scale(-1, 1);
                    break;
                case 3:
                    t.translate(n, r),
                    t.rotate(Math.PI);
                    break;
                case 4:
                    t.translate(0, r),
                    t.scale(1, -1);
                    break;
                case 5:
                    t.rotate(.5 * Math.PI),
                    t.scale(1, -1);
                    break;
                case 6:
                    t.rotate(.5 * Math.PI),
                    t.translate(0, -r);
                    break;
                case 7:
                    t.rotate(.5 * Math.PI),
                    t.translate(n, -r),
                    t.scale(-1, 1);
                    break;
                case 8:
                    t.rotate(-.5 * Math.PI),
                    t.translate(-n, 0)
                }
            }
            function c(e) {
                if (window.Blob && e instanceof Blob) {
                    var t = new Image
                      , n = window.URL && window.URL.createObjectURL ? window.URL : window.webkitURL && window.webkitURL.createObjectURL ? window.webkitURL : null;
                    if (!n)
                        throw Error("No createObjectURL function found to create blob url");
                    t.src = n.createObjectURL(e),
                    this.blob = e,
                    e = t
                }
                if (!e.naturalWidth && !e.naturalHeight) {
                    var r = this;
                    e.onload = function() {
                        var e = r.imageLoadListeners;
                        if (e) {
                            r.imageLoadListeners = null;
                            for (var t = 0, n = e.length; n > t; t++)
                                e[t]()
                        }
                    }
                    ,
                    this.imageLoadListeners = []
                }
                this.srcImage = e
            }
            c.prototype.render = function(e, t, n) {
                if (this.imageLoadListeners) {
                    var r = this;
                    return void this.imageLoadListeners.push(function() {
                        r.render(e, t, n)
                    })
                }
                t = t || {};
                var i = this.srcImage
                  , o = i.src
                  , u = o.length
                  , c = i.naturalWidth
                  , l = i.naturalHeight
                  , f = t.width
                  , d = t.height
                  , h = t.maxWidth
                  , g = t.maxHeight
                  , p = this.blob && "image/jpeg" === this.blob.type || 0 === o.indexOf("data:image/jpeg") || o.indexOf(".jpg") === u - 4 || o.indexOf(".jpeg") === u - 5;
                f && !d ? d = l * f / c << 0 : d && !f ? f = c * d / l << 0 : (f = c,
                d = l),
                h && f > h && (f = h,
                d = l * f / c << 0),
                g && d > g && (d = g,
                f = c * d / l << 0);
                var m = {
                    width: f,
                    height: d
                };
                for (var w in t)
                    m[w] = t[w];
                var v = e.tagName.toLowerCase();
                "img" === v ? e.src = a(this.srcImage, m, p) : "canvas" === v && s(this.srcImage, e, m, p),
                "function" == typeof this.onrender && this.onrender(e),
                n && n()
            }
            ,
            r = [],
            i = function() {
                return c
            }
            .apply(t, r),
            !(void 0 !== i && (e.exports = i))
        }()
    }
    , function(e, t) {
        function n(e) {
            function t(e) {
                for (var t = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], n = 0; 64 > n; n++) {
                    var r = F((t[n] * e + 50) / 100);
                    1 > r ? r = 1 : r > 255 && (r = 255),
                    D[N[n]] = r
                }
                for (var i = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; 64 > o; o++) {
                    var a = F((i[o] * e + 50) / 100);
                    1 > a ? a = 1 : a > 255 && (a = 255),
                    x[N[o]] = a
                }
                for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], u = 0, c = 0; 8 > c; c++)
                    for (var l = 0; 8 > l; l++)
                        U[u] = 1 / (D[N[u]] * s[c] * s[l] * 8),
                        C[u] = 1 / (x[N[u]] * s[c] * s[l] * 8),
                        u++
            }
            function n(e, t) {
                for (var n = 0, r = 0, i = new Array, o = 1; 16 >= o; o++) {
                    for (var a = 1; a <= e[o]; a++)
                        i[t[r]] = [],
                        i[t[r]][0] = n,
                        i[t[r]][1] = o,
                        r++,
                        n++;
                    n *= 2
                }
                return i
            }
            function r() {
                y = n(W, H),
                b = n(V, X),
                S = n(z, q),
                I = n(Q, Y)
            }
            function i() {
                for (var e = 1, t = 2, n = 1; 15 >= n; n++) {
                    for (var r = e; t > r; r++)
                        A[32767 + r] = n,
                        T[32767 + r] = [],
                        T[32767 + r][1] = n,
                        T[32767 + r][0] = r;
                    for (var i = -(t - 1); -e >= i; i++)
                        A[32767 + i] = n,
                        T[32767 + i] = [],
                        T[32767 + i][1] = n,
                        T[32767 + i][0] = t - 1 + i;
                    e <<= 1,
                    t <<= 1
                }
            }
            function o() {
                for (var e = 0; 256 > e; e++)
                    k[e] = 19595 * e,
                    k[e + 256 >> 0] = 38470 * e,
                    k[e + 512 >> 0] = 7471 * e + 32768,
                    k[e + 768 >> 0] = -11059 * e,
                    k[e + 1024 >> 0] = -21709 * e,
                    k[e + 1280 >> 0] = 32768 * e + 8421375,
                    k[e + 1536 >> 0] = -27439 * e,
                    k[e + 1792 >> 0] = -5329 * e
            }
            function a(e) {
                for (var t = e[0], n = e[1] - 1; n >= 0; )
                    t & 1 << n && (G |= 1 << O),
                    n--,
                    O--,
                    0 > O && (255 == G ? (s(255),
                    s(0)) : s(G),
                    O = 7,
                    G = 0)
            }
            function s(e) {
                M.push(j[e])
            }
            function u(e) {
                s(e >> 8 & 255),
                s(255 & e)
            }
            function c(e, t) {
                var n, r, i, o, a, s, u, c, l, f = 0;
                const d = 8
                  , h = 64;
                for (l = 0; d > l; ++l) {
                    n = e[f],
                    r = e[f + 1],
                    i = e[f + 2],
                    o = e[f + 3],
                    a = e[f + 4],
                    s = e[f + 5],
                    u = e[f + 6],
                    c = e[f + 7];
                    var g = n + c
                      , p = n - c
                      , m = r + u
                      , w = r - u
                      , v = i + s
                      , y = i - s
                      , b = o + a
                      , S = o - a
                      , I = g + b
                      , P = g - b
                      , F = m + v
                      , D = m - v;
                    e[f] = I + F,
                    e[f + 4] = I - F;
                    var x = .707106781 * (D + P);
                    e[f + 2] = P + x,
                    e[f + 6] = P - x,
                    I = S + y,
                    F = y + w,
                    D = w + p;
                    var U = .382683433 * (I - D)
                      , C = .5411961 * I + U
                      , T = 1.306562965 * D + U
                      , A = .707106781 * F
                      , R = p + A
                      , M = p - A;
                    e[f + 5] = M + C,
                    e[f + 3] = M - C,
                    e[f + 1] = R + T,
                    e[f + 7] = R - T,
                    f += 8
                }
                for (f = 0,
                l = 0; d > l; ++l) {
                    n = e[f],
                    r = e[f + 8],
                    i = e[f + 16],
                    o = e[f + 24],
                    a = e[f + 32],
                    s = e[f + 40],
                    u = e[f + 48],
                    c = e[f + 56];
                    var G = n + c
                      , O = n - c
                      , _ = r + u
                      , B = r - u
                      , E = i + s
                      , j = i - s
                      , k = o + a
                      , N = o - a
                      , W = G + k
                      , H = G - k
                      , z = _ + E
                      , q = _ - E;
                    e[f] = W + z,
                    e[f + 32] = W - z;
                    var V = .707106781 * (q + H);
                    e[f + 16] = H + V,
                    e[f + 48] = H - V,
                    W = N + j,
                    z = j + B,
                    q = B + O;
                    var X = .382683433 * (W - q)
                      , Q = .5411961 * W + X
                      , Y = 1.306562965 * q + X
                      , K = .707106781 * z
                      , J = O + K
                      , Z = O - K;
                    e[f + 40] = Z + Q,
                    e[f + 24] = Z - Q,
                    e[f + 8] = J + Y,
                    e[f + 56] = J - Y,
                    f++
                }
                var $;
                for (l = 0; h > l; ++l)
                    $ = e[l] * t[l],
                    L[l] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
                return L
            }
            function l() {
                u(65504),
                u(16),
                s(74),
                s(70),
                s(73),
                s(70),
                s(0),
                s(1),
                s(1),
                s(0),
                u(1),
                u(1),
                s(0),
                s(0)
            }
            function f(e, t) {
                u(65472),
                u(17),
                s(8),
                u(t),
                u(e),
                s(3),
                s(1),
                s(17),
                s(0),
                s(2),
                s(17),
                s(1),
                s(3),
                s(17),
                s(1)
            }
            function d() {
                u(65499),
                u(132),
                s(0);
                for (var e = 0; 64 > e; e++)
                    s(D[e]);
                s(1);
                for (var t = 0; 64 > t; t++)
                    s(x[t])
            }
            function h() {
                u(65476),
                u(418),
                s(0);
                for (var e = 0; 16 > e; e++)
                    s(W[e + 1]);
                for (var t = 0; 11 >= t; t++)
                    s(H[t]);
                s(16);
                for (var n = 0; 16 > n; n++)
                    s(z[n + 1]);
                for (var r = 0; 161 >= r; r++)
                    s(q[r]);
                s(1);
                for (var i = 0; 16 > i; i++)
                    s(V[i + 1]);
                for (var o = 0; 11 >= o; o++)
                    s(X[o]);
                s(17);
                for (var a = 0; 16 > a; a++)
                    s(Q[a + 1]);
                for (var c = 0; 161 >= c; c++)
                    s(Y[c])
            }
            function g() {
                u(65498),
                u(12),
                s(3),
                s(1),
                s(0),
                s(2),
                s(17),
                s(3),
                s(17),
                s(0),
                s(63),
                s(0)
            }
            function p(e, t, n, r, i) {
                var o, s = i[0], u = i[240];
                const l = 16
                  , f = 63
                  , d = 64;
                for (var h = c(e, t), g = 0; d > g; ++g)
                    R[N[g]] = h[g];
                var p = R[0] - n;
                n = R[0],
                0 == p ? a(r[0]) : (o = 32767 + p,
                a(r[A[o]]),
                a(T[o]));
                for (var m = 63; m > 0 && 0 == R[m]; m--)
                    ;
                if (0 == m)
                    return a(s),
                    n;
                for (var w, v = 1; m >= v; ) {
                    for (var y = v; 0 == R[v] && m >= v; ++v)
                        ;
                    var b = v - y;
                    if (b >= l) {
                        w = b >> 4;
                        for (var S = 1; w >= S; ++S)
                            a(u);
                        b = 15 & b
                    }
                    o = 32767 + R[v],
                    a(i[(b << 4) + A[o]]),
                    a(T[o]),
                    v++
                }
                return m != f && a(s),
                n
            }
            function m() {
                for (var e = String.fromCharCode, t = 0; 256 > t; t++)
                    j[t] = e(t)
            }
            function w(e) {
                if (0 >= e && (e = 1),
                e > 100 && (e = 100),
                P != e) {
                    var n = 0;
                    n = 50 > e ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
                    t(n),
                    P = e
                }
            }
            function v() {
                var t = (new Date).getTime();
                e || (e = 50),
                m(),
                r(),
                i(),
                o(),
                w(e);
                (new Date).getTime() - t
            }
            var y, b, S, I, P, F = (Math.round,
            Math.floor), D = new Array(64), x = new Array(64), U = new Array(64), C = new Array(64), T = new Array(65535), A = new Array(65535), L = new Array(64), R = new Array(64), M = [], G = 0, O = 7, _ = new Array(64), B = new Array(64), E = new Array(64), j = new Array(256), k = new Array(2048), N = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], W = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], H = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], z = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], q = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], V = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], X = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], Q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], Y = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
            this.encode = function(e, t, n) {
                var r = (new Date).getTime();
                t && w(t),
                M = new Array,
                G = 0,
                O = 7,
                u(65496),
                l(),
                d(),
                f(e.width, e.height),
                h(),
                g();
                var i = 0
                  , o = 0
                  , s = 0;
                G = 0,
                O = 7,
                this.encode.displayName = "_encode_";
                for (var c, m, v, P, F, D, x, T, A, L = e.data, R = e.width, j = e.height, N = 4 * R, W = 0; j > W; ) {
                    for (c = 0; N > c; ) {
                        for (F = N * W + c,
                        D = F,
                        x = -1,
                        T = 0,
                        A = 0; 64 > A; A++)
                            T = A >> 3,
                            x = 4 * (7 & A),
                            D = F + T * N + x,
                            W + T >= j && (D -= N * (W + 1 + T - j)),
                            c + x >= N && (D -= c + x - N + 4),
                            m = L[D++],
                            v = L[D++],
                            P = L[D++],
                            _[A] = (k[m] + k[v + 256 >> 0] + k[P + 512 >> 0] >> 16) - 128,
                            B[A] = (k[m + 768 >> 0] + k[v + 1024 >> 0] + k[P + 1280 >> 0] >> 16) - 128,
                            E[A] = (k[m + 1280 >> 0] + k[v + 1536 >> 0] + k[P + 1792 >> 0] >> 16) - 128;
                        i = p(_, U, i, y, S),
                        o = p(B, C, o, b, I),
                        s = p(E, C, s, b, I),
                        c += 32
                    }
                    W += 8
                }
                if (O >= 0) {
                    var H = [];
                    H[1] = O + 1,
                    H[0] = (1 << O + 1) - 1,
                    a(H)
                }
                if (u(65497),
                n) {
                    for (var z = M.length, q = new Uint8Array(z), V = 0; z > V; V++)
                        q[V] = M[V].charCodeAt();
                    M = [];
                    (new Date).getTime() - r;
                    return q
                }
                var X = "data:image/jpeg;base64," + btoa(M.join(""));
                M = [];
                (new Date).getTime() - r;
                return X
            }
            ,
            v()
        }
        e.exports = n
    }
    , function(e, t, n) {
        function r(e, t) {
            var n = this;
            if (!e)
                throw new Error("没有收到图片，可能的解决方案：https://github.com/think2011/localResizeIMG/issues/7");
            t = t || {},
            n.defaults = {
                width: null,
                height: null,
                fieldName: "file",
                quality: .7
            },
            n.file = e;
            for (var r in t)
                t.hasOwnProperty(r) && (n.defaults[r] = t[r]);
            return this.init()
        }
        function i(e) {
            var t = null;
            return t = e ? [].filter.call(document.scripts, function(t) {
                return -1 !== t.src.indexOf(e)
            })[0] : document.scripts[document.scripts.length - 1],
            t ? t.src.substr(0, t.src.lastIndexOf("/")) : null
        }
        function o(e) {
            var t;
            t = e.split(",")[0].indexOf("base64") >= 0 ? atob(e.split(",")[1]) : unescape(e.split(",")[1]);
            for (var n = e.split(",")[0].split(":")[1].split(";")[0], r = new Uint8Array(t.length), i = 0; i < t.length; i++)
                r[i] = t.charCodeAt(i);
            return new s.Blob([r.buffer],{
                type: n
            })
        }
        n.p = i("lrz") + "/",
        window.URL = window.URL || window.webkitURL;
        var a = n(1)
          , s = n(4)
          , u = n(5)
          , c = function(e) {
            var t = /OS (\d)_.* like Mac OS X/g.exec(e)
              , n = /Android (\d.*?);/g.exec(e) || /Android\/(\d.*?) /g.exec(e);
            return {
                oldIOS: t ? +t.pop() < 8 : !1,
                oldAndroid: n ? +n.pop().substr(0, 3) < 4.5 : !1,
                iOS: /\(i[^;]+;( U;)? CPU.+Mac OS X/.test(e),
                android: /Android/g.test(e),
                mQQBrowser: /MQQBrowser/g.test(e)
            }
        }(navigator.userAgent);
        r.prototype.init = function() {
            var e = this
              , t = e.file
              , n = "string" == typeof t
              , r = /^data:/.test(t)
              , i = new Image
              , u = document.createElement("canvas")
              , c = n ? t : URL.createObjectURL(t);
            if (e.img = i,
            e.blob = c,
            e.canvas = u,
            n ? e.fileName = r ? "base64.jpg" : t.split("/").pop() : e.fileName = t.name,
            !document.createElement("canvas").getContext)
                throw new Error("浏览器不支持canvas");
            return new a(function(n, a) {
                i.onerror = function() {
                    var e = new Error("加载图片文件失败");
                    throw a(e),
                    e
                }
                ,
                i.onload = function() {
                    e._getBase64().then(function(e) {
                        if (e.length < 10) {
                            var t = new Error("生成base64失败");
                            throw a(t),
                            t
                        }
                        return e
                    }).then(function(r) {
                        var i = null;
                        "object" == typeof e.file && r.length > e.file.size ? (i = new FormData,
                        t = e.file) : (i = new s.FormData,
                        t = o(r)),
                        i.append(e.defaults.fieldName, t, e.fileName.replace(/\..+/g, ".jpg")),
                        n({
                            formData: i,
                            fileLen: +t.size,
                            base64: r,
                            base64Len: r.length,
                            origin: e.file,
                            file: t
                        });
                        for (var a in e)
                            e.hasOwnProperty(a) && (e[a] = null);
                        URL.revokeObjectURL(e.blob)
                    })
                }
                ,
                !r && (i.crossOrigin = "*"),
                i.src = c
            }
            )
        }
        ,
        r.prototype._getBase64 = function() {
            var e = this
              , t = e.img
              , n = e.file
              , r = e.canvas;
            return new a(function(i) {
                try {
                    u.getData("object" == typeof n ? n : t, function() {
                        e.orientation = u.getTag(this, "Orientation"),
                        e.resize = e._getResize(),
                        e.ctx = r.getContext("2d"),
                        r.width = e.resize.width,
                        r.height = e.resize.height,
                        e.ctx.fillStyle = "#fff",
                        e.ctx.fillRect(0, 0, r.width, r.height),
                        c.oldIOS ? e._createBase64ForOldIOS().then(i) : e._createBase64().then(i)
                    })
                } catch (o) {
                    throw new Error(o)
                }
            }
            )
        }
        ,
        r.prototype._createBase64ForOldIOS = function() {
            var e = this
              , t = e.img
              , r = e.canvas
              , i = e.defaults
              , o = e.orientation;
            return new a(function(e) {
                !function() {
                    var a = [n(6)];
                    (function(n) {
                        var a = new n(t);
                        "5678".indexOf(o) > -1 ? a.render(r, {
                            width: r.height,
                            height: r.width,
                            orientation: o
                        }) : a.render(r, {
                            width: r.width,
                            height: r.height,
                            orientation: o
                        }),
                        e(r.toDataURL("image/jpeg", i.quality))
                    }
                    ).apply(null, a)
                }()
            }
            )
        }
        ,
        r.prototype._createBase64 = function() {
            var e = this
              , t = e.resize
              , r = e.img
              , i = e.canvas
              , o = e.ctx
              , s = e.defaults
              , u = e.orientation;
            switch (u) {
            case 3:
                o.rotate(180 * Math.PI / 180),
                o.drawImage(r, -t.width, -t.height, t.width, t.height);
                break;
            case 6:
                o.rotate(90 * Math.PI / 180),
                o.drawImage(r, 0, -t.width, t.height, t.width);
                break;
            case 8:
                o.rotate(270 * Math.PI / 180),
                o.drawImage(r, -t.height, 0, t.height, t.width);
                break;
            case 2:
                o.translate(t.width, 0),
                o.scale(-1, 1),
                o.drawImage(r, 0, 0, t.width, t.height);
                break;
            case 4:
                o.translate(t.width, 0),
                o.scale(-1, 1),
                o.rotate(180 * Math.PI / 180),
                o.drawImage(r, -t.width, -t.height, t.width, t.height);
                break;
            case 5:
                o.translate(t.width, 0),
                o.scale(-1, 1),
                o.rotate(90 * Math.PI / 180),
                o.drawImage(r, 0, -t.width, t.height, t.width);
                break;
            case 7:
                o.translate(t.width, 0),
                o.scale(-1, 1),
                o.rotate(270 * Math.PI / 180),
                o.drawImage(r, -t.height, 0, t.height, t.width);
                break;
            default:
                o.drawImage(r, 0, 0, t.width, t.height)
            }
            return new a(function(e) {
                c.oldAndroid || c.mQQBrowser || !navigator.userAgent ? !function() {
                    var t = [n(7)];
                    (function(t) {
                        var n = new t
                          , r = o.getImageData(0, 0, i.width, i.height);
                        e(n.encode(r, 100 * s.quality))
                    }
                    ).apply(null, t)
                }() : e(i.toDataURL("image/jpeg", s.quality))
            }
            )
        }
        ,
        r.prototype._getResize = function() {
            var e = this
              , t = e.img
              , n = e.defaults
              , r = n.width
              , i = n.height
              , o = e.orientation
              , a = {
                width: t.width,
                height: t.height
            };
            if ("5678".indexOf(o) > -1 && (a.width = t.height,
            a.height = t.width),
            a.width < r || a.height < i)
                return a;
            var s = a.width / a.height;
            for (r && i ? s >= r / i ? a.width > r && (a.width = r,
            a.height = Math.ceil(r / s)) : a.height > i && (a.height = i,
            a.width = Math.ceil(i * s)) : r ? r < a.width && (a.width = r,
            a.height = Math.ceil(r / s)) : i && i < a.height && (a.width = Math.ceil(i * s),
            a.height = i); a.width >= 3264 || a.height >= 2448; )
                a.width *= .8,
                a.height *= .8;
            return a
        }
        ,
        window.lrz = function(e, t) {
            return new r(e,t)
        }
        ,
        window.lrz.version = "4.9.40",
        e.exports = window.lrz
    }
    ])
});
;layui.define(function(e) {
    "use strict";
    var i = layui.$
      , n = layui.hint()
      , a = layui.device()
      , o = {
        config: {},
        set: function(e) {
            var t = this;
            return t.config = i.extend({}, t.config, e),
            t
        },
        on: function(e, i) {
            return layui.onevent.call(this, r, e, i)
        }
    }
      , l = function() {
        var e = this;
        return {
            upload: function(i) {
                e.upload.call(e, i)
            },
            config: e.config
        }
    }
      , r = "mobi_upload"
      , u = "layui-upload-file"
      , c = "layui-upload-form"
      , s = "layui-upload-iframe"
      , f = "layui-upload-choose"
      , p = function(e) {
        var t = this;
        t.config = i.extend({}, t.config, o.config, e),
        t.render()
    };
    p.prototype.config = {
        accept: "images",
        exts: "",
        auto: !0,
        bindAction: "",
        url: "",
        field: "file",
        method: "post",
        data: {},
        drag: !0,
        size: 0,
        multiple: !1
    },
    p.prototype.render = function(e) {
        var t = this
          , e = t.config;
        e.elem = i(e.elem),
        e.bindAction = i(e.bindAction),
        t.file(),
        t.events()
    }
    ,
    p.prototype.file = function() {
        var e = this
          , t = e.config
          , n = e.elemFile = i(['<input class="' + u + '" type="file" name="' + t.field + '"', t.multiple ? " multiple" : "", ">"].join(""))
          , o = t.elem.next();
        (o.hasClass(u) || o.hasClass(c)) && o.remove(),
        a.ie && a.ie < 10 && t.elem.wrap('<div class="layui-upload-wrap"></div>'),
        e.isFile() ? (e.elemFile = t.elem,
        t.field = t.elem[0].name) : t.elem.after(n),
        a.ie && a.ie < 10 && e.initIE()
    }
    ,
    p.prototype.initIE = function() {
        var e = this
          , t = e.config
          , n = i('<iframe id="' + s + '" class="' + s + '" name="' + s + '" frameborder="0"></iframe>')
          , a = i(['<form target="' + s + '" class="' + c + '" method="' + t.method, '" key="set-mine" enctype="multipart/form-data" action="' + t.url + '">', "</form>"].join(""));
        i("#" + s)[0] || i("body").append(n),
        t.elem.next().hasClass(s) || (e.elemFile.wrap(a),
        t.elem.next("." + s).append(function() {
            var e = [];
            return layui.each(t.data, function(i, t) {
                e.push('<input type="hidden" name="' + i + '" value="' + t + '">')
            }),
            e.join("")
        }()))
    }
    ,
    p.prototype.msg = function(e) {
        return $.toast(e)
    }
    ,
    p.prototype.isFile = function() {
        var e = this.config.elem[0];
        if (e)
            return "input" === e.tagName.toLocaleLowerCase() && "file" === e.type
    }
    ,
    p.prototype.preview = function(e) {
        var i = this;
        window.FileReader && layui.each(i.chooseFiles, function(i, t) {
            var n = new FileReader;
            n.readAsDataURL(t),
            n.onload = function() {
                e && e(i, t, this.result)
            }
        })
    }
    ,
    p.prototype.upload = function(e, t) {
        var n, o = this, l = o.config, r = o.elemFile[0], u = function() {
            layui.each(e || o.files || o.chooseFiles || r.files, function(e, t) {
                lrz(t, {
                    fieldName: l.field,
                    quality: .5,
                    type: t.type
                }).then(function(rst) {
                    var r = rst.formData;
                    layui.each(l.data, function(e, i) {
                        r.append(e, i)
                    });
                    i.showIndicator();
                    i.ajax({
                        url: l.url,
                        type: l.method,
                        data: r,
                        contentType: !1,
                        processData: !1,
                        dataType: "json",
                        success: function(f) {
                            i.hideIndicator();
                            d(e, f);
                        },
                        error: function() {
                            i.hideIndicator();
                            o.msg("请求上传接口出现异常"),
                            m(e)
                        },
                        xhr: l.xhr,
                        headers: l.headers,
                        xhrFields: {
                            withCredentials: true
                        },
                        crossDomain: true
                    })
                }).catch(function(err) {
                    o.msg("图片文件错误"),
                    m(e)
                })
            })
        }, c = function() {
            var e = i("#" + s);
            o.elemFile.parent().submit(),
            clearInterval(p.timer),
            p.timer = setInterval(function() {
                var i, t = e.contents().find("body");
                try {
                    i = t.text()
                } catch (n) {
                    o.msg("获取上传后的响应信息出现异常"),
                    clearInterval(p.timer),
                    m()
                }
                i && (clearInterval(p.timer),
                t.html(""),
                d(0, i))
            }, 30)
        }, d = function(e, i) {
            if (o.elemFile.next("." + f).remove(),
            r.value = "",
            "object" != typeof i)
                try {
                    i = JSON.parse(i)
                } catch (t) {
                    return i = {},
                    o.msg("请对上传接口返回有效JSON")
                }
            "function" == typeof l.done && l.done(i, e || 0, function(e) {
                o.upload(e)
            })
        }, m = function(e) {
            l.auto && (r.value = ""),
            "function" == typeof l.error && l.error(e || 0, function(e) {
                o.upload(e)
            })
        }, v = l.exts, h = function() {
            var i = [];
            return layui.each(e || o.chooseFiles, function(e, t) {
                i.push(t.name)
            }),
            i
        }(), g = {
            preview: function(e) {
                o.preview(e)
            },
            upload: function(e, i) {
                var t = {};
                t[e] = i,
                o.upload(t)
            },
            pushFile: function() {
                return o.files = o.files || {},
                layui.each(o.chooseFiles, function(e, i) {
                    o.files[e] = i
                }),
                o.files
            }
        }, y = function() {
            return "choose" === t ? l.choose && l.choose(g) : (l.before && l.before(g),
            a.ie ? a.ie > 9 ? u() : c() : void u())
        };
        switch (h = 0 === h.length ? r.value.match(/[^\/\\]+\..+/g) || [] || "" : h,
        l.accept) {
        case "file":
            if (v && !RegExp("\\w\\.(" + v + ")$", "i").test(escape(h)))
                return o.msg("选择的文件中包含不支持的格式"),
                r.value = "";
            break;
        case "video":
            if (!RegExp("\\w\\.(" + (v || "avi|mp4|wma|rmvb|rm|flash|3gp|flv") + ")$", "i").test(escape(h)))
                return o.msg("选择的视频中包含不支持的格式"),
                r.value = "";
            break;
        case "audio":
            if (!RegExp("\\w\\.(" + (v || "mp3|wav|mid") + ")$", "i").test(escape(h)))
                return o.msg("选择的音频中包含不支持的格式"),
                r.value = "";
            break;
        default:
            if (layui.each(h, function(e, i) {
                RegExp("\\w\\.(" + (v || "jpg|png|gif|bmp|jpeg$") + ")", "i").test(escape(i)) || (n = !0)
            }),
            n)
                return o.msg("选择的图片中包含不支持的格式"),
                r.value = ""
        }
        if (l.size > 0 && !(a.ie && a.ie < 10)) {
            var F;
            if (layui.each(o.chooseFiles, function(e, i) {
                if (i.size > 1024 * l.size) {
                    var t = l.size / 1024;
                    t = t >= 1 ? Math.floor(t) + (t % 1 > 0 ? t.toFixed(1) : 0) + "MB" : l.size + "KB",
                    r.value = "",
                    F = t
                }
            }),
            F)
                return o.msg("文件不能超过" + F)
        }
        y()
    }
    ,
    p.prototype.events = function() {
        var e = this
          , t = e.config
          , o = function(i) {
            e.chooseFiles = {},
            layui.each(i, function(i, t) {
                var n = (new Date).getTime();
                e.chooseFiles[n + "-" + i] = t
            })
        }
          , l = function(i, n) {
            var a = e.elemFile
              , o = i.length > 1 ? i.length + "个文件" : (i[0] || {}).name || a[0].value.match(/[^\/\\]+\..+/g) || [] || "";
            a.next().hasClass(f) && a.next().remove(),
            e.upload(null, "choose"),
            e.isFile() || t.choose || a.after('<span class="layui-inline ' + f + '">' + o + "</span>")
        };
        t.elem.off("upload.start").on("upload.start", function() {
            var a = i(this)
              , o = a.attr("lay-data");
            if (o)
                try {
                    o = new Function("return " + o)(),
                    e.config = i.extend({}, t, o)
                } catch (l) {
                    n.error("Upload element property lay-data configuration item has a syntax error: " + o)
                }
            e.config.item = a,
            e.elemFile[0].click()
        }),
        a.ie && a.ie < 10 || t.elem.off("upload.over").on("upload.over", function() {
            var e = i(this);
            e.attr("lay-over", "")
        }).off("upload.leave").on("upload.leave", function() {
            var e = i(this);
            e.removeAttr("lay-over")
        }).off("upload.drop").on("upload.drop", function(n, a) {
            var r = i(this)
              , u = a.originalEvent.dataTransfer.files || [];
            r.removeAttr("lay-over"),
            o(u),
            t.auto ? e.upload(u) : l(u)
        }),
        e.elemFile.off("upload.change").on("upload.change", function() {
            var i = this.files || [];
            o(i),
            t.auto ? e.upload() : l(i)
        }),
        t.bindAction.off("upload.action").on("upload.action", function() {
            e.upload()
        }),
        t.elem.data("haveEvents") || (e.elemFile.on("change", function() {
            i(this).trigger("upload.change")
        }),
        t.elem.on("click", function() {
            e.isFile() || i(this).trigger("upload.start")
        }),
        t.drag && t.elem.on("dragover", function(e) {
            e.preventDefault(),
            i(this).trigger("upload.over")
        }).on("dragleave", function(e) {
            i(this).trigger("upload.leave")
        }).on("drop", function(e) {
            e.preventDefault(),
            i(this).trigger("upload.drop", e)
        }),
        t.bindAction.on("click", function() {
            if (t.bindAction.hasClass('disabled')) {
                return
            }
            t.bindAction.addClass('disabled');
            i(this).trigger("upload.action")
        }),
        t.elem.data("haveEvents", !0))
    }
    ,
    o.render = function(e) {
        var i = new p(e);
        return l.call(i)
    }
    ,
    e(r, o)
});
/*upload 和压缩*/
layui.define(['jquery', 'md5', 'mobi_form', 'mobi_upload'], function(exports) {
    "use strict";
    var $ = layui.jquery
      , md = layui.md5
      , MOD_NAME = 'DS'
      , mobi_upload = layui.mobi_upload;
    var ds = {
        services: {},
        module_name: 'm',
        module: 'home',
        //板块admin后台 home前台，mobi 手机端
        // base_url: js.substr(0, js.length - 4),
        base_url: 'http://www.xiguvip.com/',
        // base_url: 'http://192.168.1.128/201807/dgc_digital/',
        sendAjax: function($param) {
            var $params = $.extend(true, {}, $param);
            var $data = $params.data;
            if (!$data) {
                return
            }
            var m = ds.getQueryString(ds.module_name);
            m && ($data[ds.module_name] = ds.getQueryString(ds.module_name));
            var key = md5(JSON.stringify($data));
            if (ds.services[key]) {
                return;
            }
            // var data = ds.url($data, true);
            var show = true
              , complete = function() {
                show = false;
                if (ds.module == 'mobi') {
                    $.hideIndicator();
                } else {
                    layui.layer.closeAll('loading');
                }
                delete ds.services[key];
            };
            setTimeout(function() {
                if (show) {
                    if (ds.module == 'mobi') {
                        $.showIndicator();
                    } else {
                        layui.layer.load(2);
                    }
                }
            }, 2000);

            var root = $data.root || '';
            delete $data.root;
            $params.data = $data;
            var user_id = layui.data('2957297735fbf429');
            var $ajax = $.extend({}, {
                type: 'post',
                dataType: 'json',
                url: this.base_url + (root || ''),
                xhrFields: {
                    withCredentials: true
                },
                crossDomain: true,
                headers: {
                    'Isapp': true,
                    Sign: ds.url($data, true)
                },
                complete: function() {
                    complete();
                },
                error: function(XMLHttpRequest, textStatus) {
                    ds.errorMsg(textStatus);
                },
                success: function(d) {
                    if (d.code == 200) {
                        ds.successMsg(d);
                    } else {
                        ds.errorMsg(d);
                    }
                }
            }, $params);
            $.ajax($ajax);
        },
        sendFormAjax: function(target, $form, $success_callback, $err_callback) {
            var button = $(target);

            if (button.hasClass('disabled')) {
                return false
            }
            button.addClass('disabled');
            var d = $($form).serializeObject();
            d[ds.module_name] = ds.getQueryString(ds.module_name);
            var root = d.root || '';
            delete d.root;
            var forms = new FormData($form);
            var data = new FormData();
            var i = forms.entries();
            var input;
            do {
                input = i.next().value;
                if (input && typeof input[1].name === 'string') {
                    if (input[1].name) {
                        data.append(input[0], input[1]);
                    }

                }
                if (input && input[0] != 'root') {
                    data.append(input[0], input[1]);
                }

            } while (input);data.append(ds.module_name, d[ds.module_name]);

            // layer.load();
            // var oHtml = button.html();
            // button.html('<i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe63d;</i>');
            ds.sendAjax({
                contentType: false,
                processData: false,
                url: this.base_url + (root || ''),
                data: data,
                success: function(d) {
                    button.removeClass('disabled');
                    // button.html(oHtml);
                    // layer.closeAll('loading');
                    if (d.code == 200) {
                        ds.successMsg(d, $success_callback)
                    } else {
                        ds.errorMsg(d);
                        $err_callback && $err_callback(d);
                    }
                },
                error: function(XMLHttpRequest, textStatus) {
                    button.removeClass('disabled');
                    // button.html(oHtml);
                    // layer.closeAll('loading');
                    ds.errorMsg(textStatus);
                    $err_callback && $err_callback({});
                }
            });
        },
        sendButtonAjax: function(target, params, $success_callback, $err_callback) {
            var button = $(target);
            if (button.hasClass('disabled')) {
                return false
            }
            button.addClass('disabled');
            // layer.load();
            // var oHtml = button.html();
            // button.html('<i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop" style="font-size: 20px">&#xe63d;</i>');
            ds.sendAjax({
                data: params,
                success: function(data) {
                    // console.log(data);
                    // layer.closeAll('loading');
                    if (ds.module == 'admin') {//避免重复点击
                    // button.html(oHtml);
                    }
                    button.removeClass('disabled');
                    if (data.state == '0000') {
                        //成功后刷新页面
                        ds.successMsg(data, $success_callback)
                    } else {

                        button.removeClass('disabled');
                        //避免重复点击
                        // button.html(oHtml);
                        ds.errorMsg(data);
                        $err_callback && $err_callback(data);
                    }
                },
                error: function(XMLHttpRequest, textStatus) {
                    button.removeClass('disabled');
                    // button.html(oHtml);
                    // layer.closeAll('loading');
                    ds.errorMsg(textStatus);
                    $err_callback && $err_callback({});
                }
            });
        },
        on: function(events, callback) {
            return layui.onevent.call(this, MOD_NAME, events, callback)
        },
        click: function(filter, callback) {
            ds.on('ds(' + filter + ')', callback);
            return this;
        },
        blur: function(filter, callback) {
            ds.on('ds_blur(' + filter + ')', callback);
            return this;
        },
        callback: function(filter, callback) {
            return ds.on('ds_callback(' + filter + ')', callback);
        },
        url: function($param, post) {
            var paramStr = "";
            $param[ds.module_name] ? '' : ($param[ds.module_name] = ds.getQueryString(ds.module_name));
            delete $param['sign'];
            //加密
            for (var ki in $param) {
                paramStr += "&" + ki + "=" + encodeURIComponent($param[ki]);
            }
            var sdic = Object.keys($param).sort();
            var $baseQuery = '';
            for (var ki in sdic) {
                if (typeof $param[sdic[ki]] === 'object') {
                    $baseQuery += JSON.stringify($param[sdic[ki]]);
                } else {
                    $baseQuery += $param[sdic[ki]];
                }
            }
            var sign = md.md5($baseQuery);
            paramStr += '&sign=' + sign;
            return post ? sign : '?' + paramStr.substr(1);
        },
        addCss: function(css) {
            layui.link(layui.base + css);
        },
        addScript: function(script) {
            $('body').append('<script src="' + layui.base + script + '"></script>');
        },
        getBaseUrl: function() {
            var base_root = ds.getRootUrl();
            return base_root.substring(0, base_root.lastIndexOf('/') + 1);
        },
        getRootUrl: function() {
            return location.href.split('#')[0].replace(location.search, '');
        },
        getApplicationUrl: function() {
            var base_root = ds.getBaseUrl();
            switch (ds.module) {
            case 'admin':
                return base_root + 'admin';
            case 'home':
                return base_root + '';
            case 'mobi':
                return base_root + 'mobi';
            }
        },
        getQueryString: function(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)','i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return unescape(r[2]);
            }
            return '';
        },
        checkNames: function(v, n) {
            switch (parseInt(v)) {
            case 0:
                return '<span class="layui-color-orange">' + n + '</div>';
                break;
            case 1:
                return '<span class="layui-color-blue">' + n + '</div>';
                break;
            case 2:
                return '<span class="layui-color-red">' + n + '</div>';
                break
            }

        },
        openOrClose: function(v, data) {
            var html = '';
            for (var k in data) {
                html += 'data-' + k + '="' + data[k] + '"';
            }
            if (html) {
                html += ' lay-click="editField" lay-filter="editField" '
            }
            switch (parseInt(v)) {
            case 0:
                return '<span style="white-space:nowrap; " class="layui-color-gray" ' + html + ' ><i class="fa fa-ban"></i> 关闭中</span>';
                break;
            case 1:
                return '<span style="white-space:nowrap; "  class="layui-color-green" ' + html + '><i class="fa fa-check-circle-o"></i> 开启中</span>';
                break;
            }
            return '';
        },
        //调用微信JS api 支付
        jsApiCall: function($jsApiParameters) {
            WeixinJSBridge.invoke('getBrandWCPayRequest', $jsApiParameters, function(res) {
                WeixinJSBridge.log(res.err_msg);
                alert(res.err_code + res.err_desc + res.err_msg);
            });
        },
        callpay: function($jsApiParameters) {
            if (typeof WeixinJSBridge == "undefined") {
                if (document.addEventListener) {
                    document.addEventListener('WeixinJSBridgeReady', ds.jsApiCall($jsApiParameters), false);
                } else if (document.attachEvent) {
                    document.attachEvent('WeixinJSBridgeReady', ds.jsApiCall($jsApiParameters));
                    document.attachEvent('onWeixinJSBridgeReady', ds.jsApiCall($jsApiParameters));
                }
            } else {
                ds.jsApiCall($jsApiParameters);
            }
        },
    }
    $(document).off("click", "*[lay-click]").on("click", "*[lay-click]", function(e) {
        var $this = $(this);
        var filter = $this.attr('lay-filter') || $this.attr('lay-click');

        //兼容之前的lay-filter
        layui.event.call(this, MOD_NAME, 'ds(' + filter + ')', {
            elem: this,
            data: $(this).data(),
            e: e
        });
    });
    $(document).off("blur", "*[lay-blur]").on("blur", "*[lay-blur]", function(e) {
        var filter = $(this).attr('lay-blur');
        layui.event.call(this, MOD_NAME, 'ds_blur(' + filter + ')', {
            elem: this,
            data: $(this).data(),
            e: e
        });
    });

    ds.click('sendCode', function(d) {
        console.log(1);
        var button = $(d.elem)
          , send = button.data('send') || 0
          , b = button.data('b') || 0;
        var html = button.html();
        var timestamp = 120;
        var mobile = button.parents('.layui-form').find('.tel').val();

        if (mobile == '') {
            ds.errorMsg('请输入手机号');

            return false;
        }
         var result = captchaObj.getValidate();

        if(!result){
             ds.errorMsg('请先验证验证码');
             return false;
        }

        var verify = button.parents('.layui-form').find('.verify').val()
        ds.sendButtonAjax(button, {
            s: 'Public.SendCode',
            root:"user/authcode/send",
            tel: mobile,
            geetest_challenge:result.geetest_challenge,
            geetest_validate:result.geetest_validate,
            geetest_seccode:result.geetest_seccode,
            verify: verify,
            send: send,
            b: b
        }, function(d) {
            if (d.msgCode) {
                $.alert(d.msgCode)
            }
            button.addClass('disabled');
            var timer = setInterval(function() {
                button.html(timestamp)
                timestamp--;
                if (timestamp == 0) {
                    button.removeClass('disabled');
                    button.html(html);
                    clearInterval(timer);
                }
            }, 1000);
        }, function() {
            button.parents('.layui-form').find('.change_verify').trigger('click');
            if (b == 1) {
                button.parents('.layui-form').find('.dragVerify').dragVerify({
                    width: '100%'
                });
            }
        });
    });
    exports('basis', ds);
});
